#include<iostream>
using namespace std;
int exam4_36()
{
	int s1, s2;
	int day = 0;
	int max = 8;
	int i;
	for (i = 1; i <= 7; i++)
	{
		cin >> s1 >> s2;
		if (s1 + s2 > max)
		{
			max = s1 + s2;
			day = i;
		}
	}
	if (max > 8)
	{
		cout << day;
	}
	else cout << "0";
	return 0;
}